package javalearning.fileoperate.fileWorker;

import java.io.File;

public class fileio {
    public static void main(String[] args) {
        System.out.println("begins");
        begins();
    }

    private static void begins() {
        File sourceFile = new File("D:\\资料\\电子书\\多看阅读\\res");
        File[] filesArray = sourceFile.listFiles();
        for (File file : filesArray) {
            //D:\资料\电子书\多看阅读\res\res01.pdf
            String ss = file.getName();
            String res = ss.substring(ss.indexOf('s') + 1);
            File n = new File(sourceFile, res);
            file.renameTo(n);
        }
    }
}
